//
//  MyPoint.m
//  citzenWorkStation
//
//  Created by yang qing on 2018/3/7.
//  Copyright © 2018年 yang qing. All rights reserved.
//

#import "MyPoint.h"

@implementation MyPoint

-(void) encodeWithCoder:(NSCoder *)aCoder{
    //在编码方法中，需要对对象的每一个属性进行编码。
    [aCoder encodeDouble:_lat forKey:@"lat"];
    [aCoder encodeDouble:_lon forKey:@"lon"];
    [aCoder encodeDouble:_x forKey:@"x"];
    [aCoder encodeDouble:_y forKey:@"y"];
    [aCoder encodeObject:_positionStr forKey:@"positionStr"];
  
}

-(instancetype)initWithCoder:(NSCoder *)aDecoder{
    self = [super init];
    if (self) {
        _lat = [aDecoder decodeDoubleForKey:@"lat"];
        _lon = [aDecoder decodeDoubleForKey:@"lon"];
        _x  = [aDecoder decodeDoubleForKey:@"x"];
        _y = [aDecoder decodeDoubleForKey:@"y"];
        _positionStr = [aDecoder decodeObjectForKey:@"positionStr"];
        
    }
    return self;
}
@end
